package com.elvin.smartgethttp;


import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;


public class MainActivity extends ListActivity {
	
	private ArrayAdapter<ListCellData> adapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        adapter = new ArrayAdapter<ListCellData>(this, android.R.layout.simple_list_item_1);
        setListAdapter(adapter);
        
        adapter.add(new ListCellData(this, "TestHttp", new Intent(this, HttpActivity.class)));
        adapter.add(new ListCellData(this, "SmartTag", new Intent(this, AtySmartTag.class)));
    }

    protected void onListItemClick(ListView l, View v, int position, long id) {
    	// TODO Auto-generated method stub
    	ListCellData data = adapter.getItem(position);
    	data.startActivity();
    	super.onListItemClick(l, v, position, id);
    }
    
}
